﻿<UserControl x:Class="Apex.Common.GUI.MetroTile"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:conv="clr-namespace:Apex.Common.GUI.Converters"
             DataContext="{Binding RelativeSource={RelativeSource Self}}"
             mc:Ignorable="d" Height="150" Width="{Binding Height}">
    <UserControl.Resources>
        <Canvas Width="48" Height="48" Clip="F1 M 0,0L 48,0L 48,48L 0,48L 0,0" UseLayoutRounding="False" x:Key="appbar_question">
            <Path Width="16" Height="25" Canvas.Left="16" Canvas.Top="11" Stretch="Fill" Fill="Black" Data="F1 M 23.5,31C 24.8807,31 26,32.1193 26,33.5C 26,34.8807 24.8807,36 23.5,36C 22.1193,36 21,34.8807 21,33.5C 21,32.1193 22.1193,31 23.5,31 Z M 24,11C 28.4183,11 32,13.8579 32,18C 32,19.5 31,22 29,23C 27,24 26,25.3431 26,27L 26,29L 21,29L 21,27.5C 21,24.0992 24,22 25,21C 27,19 27,18.7226 27,18C 27,16.3432 25.6568,15 24,15C 22.3431,15 21,16.3432 21,18L 21,19.5L 16,19.5L 16,18.5C 16,14.3579 19.5817,11 24,11 Z " />
        </Canvas>
        <conv:WidthToFontSizeConverter x:Key="wtfsConverter" />
    </UserControl.Resources>
    <Border Background="{Binding TileBackground}">
        <Grid>
            <ContentPresenter Name="cntContent" Content="{Binding Icon}" VerticalAlignment="Center" HorizontalAlignment="Center" TextElement.FontFamily="Entypo" TextElement.FontSize="72" TextElement.FontWeight="Light"/>
            <TextBlock Name="lblLabel" Text="{Binding Label}" FontSize="{Binding Height, Converter={StaticResource wtfsConverter}}" FontWeight="Black" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="10"/>
        </Grid>
    </Border>
</UserControl>
